package writenote.io;

import java.io.*;

public class ObjectStream {
    public static void main(String[] args) throws IOException {
        /*对象流（高级流）：进行对象的序列化与反序列化*/
        //对象系列化：写出的对象按照其结构转换为一组字节
        String name ="崔润彬";
        int age = 27;
        int height =175;
        String []otherInfo={"做编程的","喜欢学习"};
        ObjectPerson op = new ObjectPerson(name,age,height,otherInfo);
        FileOutputStream fos = new FileOutputStream("fos.obj");
        ObjectOutputStream oos = new ObjectOutputStream(fos);
        oos.writeObject(op);
        System.out.println("写出完毕");
        oos.close();
        //对象反序列化
    }
}
